<template>
    <div id="all">
        <div class="block">
<!--            <span class="demonstration">Click 指示器触发</span>-->
            <el-carousel trigger="click" height="400px">
                <el-carousel-item v-for="(item,index) in imgUrl" :key="index">
                    <h3 class="small" style="'background: url('item.imgUrlPc')'">
<!--                        n次失败的背景写法-->
<!--                        <div style="'background: url('item.imgUrlPc')'">-->
<!--                            asdas-->
<!--                        </div>-->
                        <img :src="item.imgUrlPc" alt="" class="rotationImg">
                    </h3>
                </el-carousel-item>
            </el-carousel>
        </div>
    </div>
</template>

<script>

    import {rotation} from "../../../api";
    export default {
        name: "rotation",
        data(){
            return {
                imgUrl:[]
            }
        },
        methods:{

        },
        created: function () {
            // this.$axios.get("http://wkt.myhope365.com/weChat/applet/course/banner/list",).then(res=>{
            //
            // })
            rotation().then(res =>{
                // console.log(res.data)
                this.imgUrl=res.data
            })
            // 旧数据参考
            // this.imgUrl=res.data.data
        }
    }
</script>



<style>
    .el-carousel__item h3 {
        color: #475669;
        font-size: 14px;
        opacity: 0.75;
        line-height: 150px;
        margin: 0;
    }

    .el-carousel__item:nth-child(2n) {
        background-color: #99a9bf;
    }

    .el-carousel__item:nth-child(2n+1) {
        background-color: #d3dce6;
    }
/*    轮播图魔改相关*/
    .block img{
        width: 150%;
        height: 400px;
        position: relative;
        left: -25%;
    }
    .rotationImg {

    }
/*    与下个组件之间的距离*/
    .all {
        margin-bottom: 50px;
    }
</style>